//
//  CycllingView.m
//  quickDoctor
//
//  Created by zhaowei on 17/3/8.
//  Copyright © 2017年 SWS. All rights reserved.
//

#import "CycllingView.h"
#import <SDCycleScrollView.h>


@interface CycllingView()<SDCycleScrollViewDelegate>

@end
@implementation CycllingView

- (instancetype)initWithFrame:(CGRect)frame {
    if(self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}


- (void)setupUI {
    
    self.backgroundColor = [UIColor greenColor];
    
    
    SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0,0, 375, 180) delegate:self placeholderImage:[UIImage imageNamed:@"content_img_02"]];
    
    NSArray *imagesUrlStr = @[
                     @"http://img.guahao.com/portal_upload/rollingnews/1453447883150.jpg",
                     @"http://img.guahao.com/portal_upload/mediafocus/1461826474435.jpg",
                     @"http://img.guahao.com/portal_upload/rollingnews/1461574027543.jpg"
                     ];
    cycleScrollView.imageURLStringsGroup = imagesUrlStr;
    
    cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
    
    //设置间隔时间
    cycleScrollView.autoScrollTimeInterval = 2;
    
    
    [self addSubview:cycleScrollView];
    
    
    
    
    
//    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
//    parameters[@"user_id"] = @1000089;
//    parameters[@"page_size"] = @15;
//    parameters[@"page"] = @1;
//    [[NETWorkTool sharedTool] GETWithUrlStr:@"http://iosapi.itcast.cn/doctorList.json.php" parameters:parameters success:^(id response) {
//        NSLog(@"成功");
//    } failure:^(NSError * error) {
//        NSLog(@"失败");
//    }];

    
    
 }
@end
/*
 请求地址: http://iosapi.itcast.cn/banners.json.php
 请求参数:{ @"login_token":@"985c96ce43bb5ef69de3e1ad8afaa83f",page_size":10,"page":1}

 请求地址: http://iosapi.itcast.cn/doctorList.json.php
 请求参数:{"user_id":1000089,"page_size":15,"page":1}

*/
